package com.renli.service.impl;

import com.renli.mapper.Train_PlanMapper;
import com.renli.pojo.Train;
import com.renli.pojo.TrainFeedback;
import com.renli.service.Train_planService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: zdk
 * Date: 2020/09/02 14:10
 * Description:
 * Version: V1.0
 */
@Service
public class Train_PlanServiceImpl implements Train_planService {
    @Autowired(required = false)
    private Train_PlanMapper train_planMapper;

    @Override
    public Integer add_plan(Train train) {
        System.out.println("---Train_PlanMapperImpl(add_plan)----");
        Integer result = train_planMapper.add_plan(train);
        return result;
    }

    @Override
    public List<Train> query( String name,String means, String starTtime) {
        System.out.println("---Train_PlanMapperImpl(query)----");
        System.out.println( name);
        System.out.println( means);

        return train_planMapper.query(name,means,starTtime);
    }

    @Override
    public List<String> role_name(String name) {
        return train_planMapper.role_name(name);
    }

    @Override
    public Train query_reunite(String name) {
        return train_planMapper.query_reunite(name);
    }

    @Override
    public int update_reunite(String name) {
        return train_planMapper.update_reunite(name);
    }

    @Override
    public int insertFk(TrainFeedback trainFeedback) {
        System.out.println(trainFeedback.getGrade());
        return train_planMapper.insertFk(trainFeedback);
    }

    @Override
    public Train query_feedback(String name) {
        return train_planMapper.query_feedback(name);
    }

    @Override
    public Integer del_trin(String name) {
        System.out.println("dellllll");
        int reslut = train_planMapper.del_trin(name);
        return reslut;
    }

    @Override
    public int update_trin(@RequestBody Train train) {
        System.out.println("updet!!!");
        return train_planMapper.update_trin(train);
    }


}
